﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Security;
public partial class admin_Mng_Report : System.Web.UI.Page {

    protected void Page_Load(object sender, EventArgs e) {

    }
    /// <summary>
    /// Handles the SelectedIndexChanged event of the GridViewReport control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    /// <action>go to View_Report.aspx with component_id and dateRecorded as query string</action>
    protected void GridViewReport_SelectedIndexChanged(object sender, EventArgs e) {
        Label component_idLabel = GridViewReport.SelectedRow.Cells[0].FindControl("component_idLabel") as Label;
        string dateRecorded = GridViewReport.SelectedRow.Cells[1].Text;
        Server.Transfer("View_Report.aspx?component_id=" + component_idLabel.Text + "&dateRecorded=" + dateRecorded);
    }
    /// <summary>
    /// Handles the Click event of the CreateReportButton control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    /// <action>go to Create_Report.aspx</action>
    protected void CreateReportButton_Click(object sender, EventArgs e) {
       // Server.Transfer("Create_Report.aspx");
        Response.Redirect("Create_Report.aspx");
    }
    protected void OilButtonClicked(object sender, EventArgs e)
    {
        Response.Redirect("Mng_OilReport.aspx");
    }
    protected void ModifyVAButton_Click(object sender, EventArgs e)
    {
        Response.Redirect("UpdateVA.aspx");

    }
    protected void LoginStatus1_LoggingOut(object sender, LoginCancelEventArgs e)
    {


        Session.Contents.Remove("UserDetails");
        Session.Abandon();
        Session.Contents.RemoveAll();
        FormsAuthentication.SignOut();
        Response.Redirect("../Default.aspx");
    }

    protected void btnArchiveReports_Click(object sender, EventArgs e)
    {
        Response.Redirect("");
    }
}
